var Tip = (function () {
    function Tip() {
        this.panel = fairygui.UIPackage.createObject("Package", "Tip").asCom;
        this.panel.addRelation(window._view, fairygui.RelationType.Width);
        this.panel.y = window._view.height / 2 - this.panel.height;
        window._view.addChild(this.panel);
        window.mainPanel = this;
    }

    var __proto = Tip.prototype;
    var timeout;
    __proto.show = function (txt) {
        clearTimeout(timeout);

        this.panel.visible = true;
        this.panel.title = txt;

        var self = this;
        timeout = setTimeout(function () {
            self.panel.visible = false;
        }, 2000)
    }



    Tip._instance = null;
    Tip.instance = function () {
        if (!Tip._instance) {
            Tip._instance = new Tip();
        }
        return Tip._instance;
    }

    return Tip;
})()